package com.itheima.day09_IO;


import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class InputStreamTest3 {
    public static void main(String[] args) {
        read2();
    }

    public static void read2() {
        //TODO 一次读取多个字节
        try (FileOutputStream fos = new FileOutputStream("D:\\img2\\a.txt")) {
            String str = "  登鹳雀楼\r\n   王之涣\r\n白日依山尽，\r\n黄河入海流。\r\n欲穷千里目，\r\n更上一层楼。";
            fos.write(str.getBytes());
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}